GtkSnapshot: Add getters
authorMatthias Clasen <mclasen@redhat.com>
Sun, 11 Mar 2018 05:17:53 +0000 (00:17 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 11 Mar 2018 05:31:44 +0000 (00:31 -0500)
These getters can be useful when creating new snapshots
in a snapshot() vfunc.

docs/reference/gtk/gtk4-sections.txt
gtk/gtksnapshot.c
gtk/gtksnapshot.h
gtk/gtksnapshotprivate.h

index fb8707a246316cb05155f06ae0b45d40f61e4d3c..64f11cb4c34c89ef2b3da749596df866536dd6a6 100644 (file)
@@ -4171,6 +4171,8 @@ gtk_snapshot_ref
 gtk_snapshot_unref
 gtk_snapshot_to_node
 gtk_snapshot_free_to_node
+gtk_snapshot_get_renderer
+gtk_snapshot_get_record_names
 gtk_snapshot_push
 gtk_snapshot_push_transform
 gtk_snapshot_push_opacity
index ffc721754453730d64263bfcc5892969ffee0cba..a771a1adccdac1d07014c38d4bdc5c3b7868b3b8 100644 (file)
@@ -1223,11 +1223,26 @@ gtk_snapshot_pop (GtkSnapshot *snapshot)
  * Returns: (transfer none): the #GskRenderer
  */
 GskRenderer *
-gtk_snapshot_get_renderer (const GtkSnapshot *snapshot)
+gtk_snapshot_get_renderer (GtkSnapshot *snapshot)
 {
   return snapshot->renderer;
 }
 
+/**
+ * gtk_snapshot_get_record_names:
+ * @snapshot: a #GtkSnapshot
+ *
+ * Obtains whether the snapshot is recording names
+ * for debugging.
+ *
+ * Returns: whether the snapshot records names
+ */
+gboolean
+gtk_snapshot_get_record_names (GtkSnapshot *snapshot)
+{
+  return snapshot->record_names;
+}
+
 /**
  * gtk_snapshot_offset:
  * @snapshot: a $GtkSnapshot
index 67c502dea4846724d42658395fb57d684c8eaff7..767e1bcbfb2f58b5061105daff2a1c2fff14af47 100644 (file)
@@ -56,6 +56,11 @@ GskRenderNode * gtk_snapshot_free_to_node               (GtkSnapshot
 GDK_AVAILABLE_IN_ALL
 GskRenderNode * gtk_snapshot_to_node                    (GtkSnapshot            *snapshot);
 
+GDK_AVAILABLE_IN_ALL
+GskRenderer *   gtk_snapshot_get_renderer               (GtkSnapshot            *snapshot);
+GDK_AVAILABLE_IN_ALL
+gboolean        gtk_snapshot_get_record_names           (GtkSnapshot            *snapshot);
+
 GDK_AVAILABLE_IN_ALL
 void            gtk_snapshot_push                       (GtkSnapshot            *snapshot,
                                                          gboolean                keep_coordinates,
index f2117bb43f1bf369ac272b030ec21d8c98ca1427..f78b5ede1999f1ec02f587e4b7a14bf329183140 100644 (file)
@@ -88,8 +88,6 @@ struct _GtkSnapshot {
   GPtrArray             *nodes;
 };
 
-GskRenderer *   gtk_snapshot_get_renderer       (const GtkSnapshot       *snapshot);
-
 G_END_DECLS
 
 #endif /* __GTK_SNAPSHOT_PRIVATE_H__ */